package com.copro.chemdb.result;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import com.copro.simple.db.QueryCallback;

public class AnswerListGetter implements QueryCallback {

	private List<Answer> list;

	public AnswerListGetter(List<Answer> list) {
		this.list = list;
	}

	public List<Answer> getList() {
		return this.list;
	}

	@Override
	public void exec(ResultSet rs) throws SQLException {
		while (rs.next()) {
			list.add(new Answer(rs));
		}
	}
}
